Skip to content

Support MSYS2 UCRT64 environment#308

Merged
vedang merged 3 commits intovedang:masterfrom
legends2k:ucrt64
Dec 28, 2025
Merged

Support MSYS2 UCRT64 environment#308
vedang merged 3 commits intovedang:masterfrom
legends2k:ucrt64

Conversation

@legends2k
Copy link
Copy Markdown
Contributor

UCRT64 is the newer MSYS2 environment compared to MINGW{32,64}. This
is the recommended default 1.

If you are unsure, go with UCRT64.

MinGW’s compiler (GCC 14.2.0) errors out compiling `synctex_parser.c`.

```
synctex_parser.c: In function '_synctex_updater_print_gz':
synctex_parser.c:8448:13: error: implicit declaration of function
'vasprintf'; did you mean 'vsprintf'?
  8448 |     if (vasprintf(&buffer, format, va) < 0) {
    |       ^~~~~~~~~
    |       vsprintf
```

`vasprintf` is a custom function (not the standard `vsprintf`) that’s
defined in the same translation unit a few lines above.

However its definition is wrapped within a `if defined(_MSC_VER)`
i.e. it’s only enabled when compiled with MSVC compiler.  This fix
enables it also for MinGW compilers.
`vasprintf` is a function available on Linux and macOS but not in
Windows.  Instead of restricting it for MSVC and MinGW, enable it for
all compilers using standard C library function `vsnprintf`.
UCRT64 is the newer MSYS2 environment compared to MINGW{32,64}.  This
is the recommended default [1].

> If you are unsure, go with UCRT64.

[1]: https://www.msys2.org/docs/environments/
@legends2k
Copy link
Copy Markdown
Contributor Author

Note: This PR is a superset of #295.

@CommanderAsdasd
Copy link
Copy Markdown

works like a charm, would love to see it in master/melpa version

@cretinon
Copy link
Copy Markdown

cretinon commented Jun 7, 2025

same as CommanderAsdasd : works for me, would love to see it in master/melpa version
(emacs 28.2 on win10 + msys2 2025 02 21)

@shingo256
Copy link
Copy Markdown

Same here. It works for me, would love to see it in master/melpa version.
(Emacs 30.2 on Win10/11 + msys 2025 8 29)

@hnvy
Copy link
Copy Markdown

hnvy commented Dec 23, 2025

Thanks @legends2k!

Though it seems to cause a problem when double-clicking a word (using it with Org-noter)?

`pdf-info-query: epdfinfo: Unable to create synctex scanner, did you run latex with `--synctex=1' ?

@vedang vedang merged commit 93b008a into vedang:master Dec 28, 2025
svraka added a commit to svraka/MINGW-packages that referenced this pull request Jan 21, 2026
Previous workaround for `vasprintf` was fixed upstream [1]

[1]: vedang/pdf-tools#308
ognevny pushed a commit to msys2/MINGW-packages that referenced this pull request Jan 21, 2026
Previous workaround for `vasprintf` was fixed upstream [1]

[1]: vedang/pdf-tools#308
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants